package com.sing;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@MapperScan("com.sing.mapper")
// 开启通用注解扫描（默认该类的同级，和同级的下级）
//@ComponentScan("${application.basepackage}")
public class SpringbootApiApplication   extends SpringBootServletInitializer implements CommandLineRunner {
	private static final Logger logger = LoggerFactory.getLogger(SpringbootApiApplication.class);

	public static void main(String[] args) {
		SpringApplication.run(SpringbootApiApplication.class, args);
	}
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(SpringbootApiApplication.class);
	}

	@Override
	public void run(String... args) throws Exception {
		System.out.println("springboot启动完成！");
	}
}
